package com.front.web.pachongTest;

import com.bootdo.china.domain.ChinaData;
import com.bootdo.china.service.ChinaDataService;
import com.bootdo.common.utils.R;
import com.bootdo.reptile.ReptileFactory;
import com.bootdo.reptile.inteface.imp.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@Controller
@RequestMapping("/f/Pachong/")
public class Pachong {
    @Autowired
    ChinaDataService chinaDataService;


    /**
     * http://127.0.0.1/f/Pachong/index
     * @param request
     * @param response
     * @return
     */
    @ResponseBody
    @RequestMapping("index")
    public R index(HttpServletRequest request, HttpServletResponse response){
        ReptileFactory.getInstance()
                .runTask("http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2018/13/1304.html",
                        new Task(chinaDataService));
        return R.ok();
    }


}
